<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>v-bind高级</title>
    <style>
        .haha {
            background-color: darkorchid;
            height: 100px;
            width: 700px;
        }
    </style>
</head>
<body>
<div id="app">
    <!--此时class的值只能是haha，但是具体是不是要看flag，
    如果flag为true，则class的值就是哈哈，否则就为“”-->
    <button @click="flag=!flag">切换展示</button>
    <div v-bind:class="{haha:flag}">
        我是哈哈
    </div>
</div>
<script src="../node_modules/vue/dist/vue.js"></script>
<script>
    let vue = new Vue({
            el: "#app",
            data: {
                flag: true,
            }
        })
    ;
</script>
</body>
</html>